/**
 * render column overwrite querylist4ext.js
 * 
 * @param {}
 *            value
 * @param {}
 *            cellmeta
 * @param {}
 *            record
 * @param {}
 *            rowIndex
 * @param {}
 *            columnIndex
 * @param {}
 *            store
 * @return {}
 */
function renderHeader(value, cellmeta, record, rowIndex, columnIndex, store) {
	var fieldName = Ext.getCmp(querykey).getColumnModel()
			.getDataIndex(columnIndex);
	if (fieldName == 'OPEN') {
		var resultString = String
				.format(
						'<b><a target="_blank" href="'
								+ context
								+ '/system/objectcreator.do?method=view&key=APP_LXDJ&id={0}">查阅</a></b>',
						record.data.ID, value);

		if (record.data.BLSTATUS == '0') {
			resultString = String
					.format(
							'<b><a href="'
									+ context
									+ '/system/objectcreator.do?method=edit&key=APP_LXDJ&id={0}">查阅</a></b>',
							record.data.ID, value);
		}

		return resultString;
	} else if (fieldName == 'XFTIME' || fieldName == 'XJTIME'
			|| fieldName == 'OBJ_CREATETIME') {
		return formatDate(value);
	} else if (fieldName == 'BLSTATUS') {
		if (value == '0') {
			return '待处理';
		} else if (value == '1') {
			return '自处理';
		} else if (value == '2') {
			return '相关部门办理';
		} else if (value == '3') {
			return '上报处理';
		} else if (value == '-1') {
			return '不予办理';
		}
	} else if (fieldName == 'LXSTATUS') {
		if (value == '0') {
			return '否';
		} else if (value == '1') {
			return '是';
		}
	} else if (fieldName == 'LXTYPE') {
		if (value == '0') {
			return '街乡';
		} else if (value == '1') {
			return '区';
		}
	}
	return value;
}

function addToolbar() {
	var tbr = Ext.getCmp(querykey + '_toolbar');

	tbr.addSeparator();

	tbr.addButton({
		text : '来信登记(街乡)',
		iconCls : 'add',
		scope : this,
		handler : function() {
			window.location.href = context
					+ '/system/objectcreator.do?method=neu&key=APP_LXDJ&type=0&querykey='
					+ querykey;
		}
	});
	/*
	 * tbr.addButton([{ text : '重新登录', iconCls : 'icon-user' }, { text : '退出系统',
	 * iconCls : 'icon-exit' }]);
	 */
}